At 22:34 +0300 on 27/05/1999, Oliver Elphick wrote:
>
> select c.company_id, count(j.job_id)
> from company as c, jobs as j
> where c.company_id = j.company_id
> group by c.company_id;
If it's only the company_id that interests you, and not the company name or
other details in the company table, you can give up the company table
altogether. The company_id appears in the jobs table, and there is no point
in selecting c.company_id when the condition was that c.company_id is equal
to j.company_id.
In other words, if all you need is company_id, you can use:
select company_id, count(job_id)
from jobs
group by company_id;
Herouth
--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma